From bb1dd3f3ae8cf955f99f177e69604e5bceb0b5a1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 23 Mar 2019 09:11:46 -0400 Subject: [PATCH] wayland: Stop using surface->parent It is always NULL. --- gdk/wayland/gdksurface-wayland.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index b4af4e09c7..a1088a74df 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -2850,6 +2850,8 @@ gdk_wayland_surface_destroy (GdkSurface *surface, gboolean recursing, gboolean foreign_destroy) { + GdkWaylandDisplay *display; + g_return_if_fail (GDK_IS_SURFACE (surface)); /* Wayland surfaces can't be externally destroyed; we may possibly @@ -2859,11 +2861,8 @@ gdk_wayland_surface_destroy (GdkSurface *surface, gdk_wayland_surface_hide_surface (surface); - if (surface->parent == NULL) - { - GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)); - display->toplevels = g_list_remove (display->toplevels, surface); - } + display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)); + display->toplevels = g_list_remove (display->toplevels, surface); } static void -- 2.30.2